
import multiprocessing
import time
import os

lst = []

def func1(num):
    for i in range(num):
        time.sleep(.2)
        lst.append(i)
    print("func1", lst, id(lst))

def func2(num):
    for i in range(num):
        time.sleep(.2)
        lst.append(i)
    print("func2", lst, id(lst))

if __name__ == '__main__':
    # func1(10)
    # func2(10)
    print(id(lst))
    process1 = multiprocessing.Process(target=func1, args=(10,))
    process2 = multiprocessing.Process(target=func2, kwargs={"num":10})
    process1.start()
    process2.start()
    time.sleep(2)
    print("lst", lst, id(lst))




